package com.ambow.shop.action.impl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ambow.shop.action.Action;
import com.ambow.shop.domain.Product;
import com.ambow.shop.service.ProductService;
import com.ambow.shop.service.impl.ProductServiceImpl;
import com.ambow.shop.util.Page;

public class ShowHomePageAction implements Action {
	private ProductService productService = new ProductServiceImpl();
	
	@Override
	public String execute(HttpServletRequest request, HttpServletResponse response) {
		Page<Product> pagingData = productService.findProducts(1, 5);
		request.setAttribute("data", pagingData);
		return "./index.jsp";
	}

}
